Data storage device and operating method thereof

ABSTRACT

A data storage device include a storage memory, an information memory suitable for storing disk information and/or file information transmitted from a host device, and a controller suitable for processing a request on the data memory, which is received from the host device, based on the disk information and/or the file information stored in the information memory.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority of Korean Patent Application Nos. 10-2012-0113213 and 10-2012-0113216, filed on Oct. 11, 2012, which are incorporated herein by reference in their entirety.

BACKGROUND

1. Technical Field

Exemplary embodiments of the present invention relate to a data storage device, and more particularly, to a data storage device processing a request from a host device, and an operating method thereof.

2. Related Art

A flash memory is a kind of non-volatile memories and is controlled by a Flash Translation Layer (FTL) to process a request from a host device.

In general, disk information and file information may not be provided to a flash memory. Therefore, the flash memory may store a plurality of data that do not have any common characteristics in partition and/or file system in the same block.

When such irrelevant data are stored in a block included in the flash memory, the number of the blocks each including both valid pages and invalid pages may increase, and thus the available storage space may decrease. Therefore, the flash memory need to perform more garbage collection operations, and the cost for the garbage collection operations may increase due to the relatively low ratio of the invalid pages in the victim block.

Even though a TRIM command is provided by a host device to the flash memory, the TRIM function itself may not resolve the above concerns caused by the data dispersion.

SUMMARY

Various embodiments of the present invention are directed to a data storage device that may process a request from a host device by using disk information and/or file information from a host device, and an operating method thereof

In an embodiment, a data storage device may include a storage memory, an information memory suitable for storing disk information and/or file information transmitted from a host device, and a controller suitable for processing a request on the data memory, which is received from the host device, based on the disk information and/or the file information stored in the information memory.

In an embodiment, a system may include a data storage device, and a host device providing disk information and/or file information to the data storage device. The data storage device may include a storage memory, an information memory suitable for storing the disk information and/or the file information transmitted from the host device, and a controller suitable for processing a request on the data memory, received from the host device based on the disk information and/or the file information in the information memory.

In an embodiment, an operating method of a system with a host device and a data storage device may include receiving, by the data storage device, a request and information on disk and/or file corresponding to the request from the host device, identifying, by the data storage device, a first physical address corresponding to the information on disk and/or file, and processing, by the data storage device, the request on the first physical address if the first physical address is identified. The operating method of the system may further include updating, by host device, the disk information and/or the file information, and transmitting, by host device, the updated disk information and/or the updated file information to the data storage device.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a system with a data storage device and a host device in accordance with an embodiment of the present invention.

FIG. 2 is a diagram illustrating a message format including disk information provided by a host device to a data storage device in accordance with an embodiment of the present invention,

FIG. 3 illustrates an example of disk information managed by a host device in accordance with an embodiment of the present invention.

FIG. 4 illustrates an example of disk information and a physical address stored in a data storage device in accordance with an embodiment of the present invention.

FIG. 5 is a flow chart illustrating an operation of a host device when disk information is updated in accordance with an embodiment of the present invention.

FIG. 6 is a flow chart illustrating an operation of a host device when disk partition is formatted in accordance with an embodiment of the present invention.

FIG. 7 is a flow chart illustrating an operation of a data storage device to store disk information provided from a host device in accordance with an embodiment of the present invention.

FIG. 8 is a flow chart illustrating an operation of a data storage device in accordance with an embodiment of the present invention.

FIGS. 9 and 10 are diagrams illustrating a message format including file information provided by a host device to a data storage device in accordance with an embodiment of the present invention.

FIG. 11 illustrates an example of file identification number managed by a host device in accordance with an embodiment of the present invention.

FIG. 12 illustrates an example of file information and a physical address stored in a data storage device in accordance with an embodiment of the present invention.

FIG. 13 is a flow chart illustrating an operation of a host device when a file is created in accordance with an embodiment of the present invention.

FIG. 14 is a flow chart illustrating an operation of a host device when a file is modified in accordance with an embodiment of the present invention.

FIG. 15 is a flow chart illustrating an operation of a data storage device for handling a write request from a host device in accordance with an embodiment of the present invention.

FIG. 16 is a flow chart illustrating an operation of a host device when a file is deleted in accordance with an embodiment of the present invention.

FIG. 17 is a flow chart illustrating an operation of a data storage device for handling a file delete request from a host device in accordance with an embodiment of the present invention.

DETAILED DESCRIPTION

Various embodiments will be described below in more detail with reference to the accompanying drawings. The present invention may, however, be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present invention to those skilled in the art. It is also noted that in this specification, “connected/coupled” refers to one component not only directly coupling another component but also indirectly coupling another component through an intermediate component. In addition, a singular form may include a plural form as long as it is not specifically mentioned in a sentence. Throughout the disclosure, reference numerals correspond directly to the like numbered parts in the various figures and embodiments of the present invention.

FIG. 1 is a block diagram illustrating a system with a data storage device 200 and a host device 100 in accordance with an embodiment of the present invention.

In the embodiment, the host device 100 may include an application program 130, a file system 140, a device driver 150 and a first memory 160.

The application program 130 may request read or write operations to the file system 140. The file system 140 may manage data stored in the data storage device 200 with files. The host device 100 may include a plurality of file systems. The device driver 150 may send a read request and/or a write request to the data storage device 200 for handling the read or write operations. The first memory 160 may store data used by the host device 100.

The host device 100 may further include a disk information management module 110. The disk information management module 110 may manage disk information on one or more disks managed by the host device 100. Data structure of the disk information will be disclosed with reference to FIGS. 2 and 3.

The host device 100 may further include a file information management module 120. The file information management module 120 may manage file information on files managed by the host device 100. Data structure of the file information will be disclosed with reference to FIGS. 9 to 12.

The host device 100 may provide the disk information managed at the disk information management module 110 and/or the file information managed at the file information management module 120 to the data storage device 200.

The data storage device 200, for example, a solid-state drive (SSD), may include a second memory (or an information memory) 210, a controller 220, and a third memory (or a storage memory).

The second memory 210 may store the disk information and/or the file information provided from the host device 100. The controller 220 may control to process the requests on the second memory 210 received from the host device 100, based on the disk information and/or the file information stored in the second memory 210.

The third memory 230 may store data requested by the host device 100 and include a volatile memory and/or a non-volatile memory. In the following disclosure, the third memory 230 is assumed to a flash memory device using a page-level mapping.

The second memory 210 may store the disk information and/or the file information corresponding to a physical address of the third memory 230, and the second memory 210 may be embodied with a volatile memory, for example, DRAM for a high-speed operation. Throughout the disclosure, the physical address may represent a physical block address of the third memory 230, for example, a flash memory.

The data stored in the second memory 210 may be backed up. The backup data may be stored in a backup memory 240, for example, a nonvolatile memory. If the third memory 230 is a non-volatile memory, a part of the third memory 230 may be used to back up the second memory 210. The backup data may be reloaded into the second memory 210 when the host device 100 reboots and/or when the data storage device 200 is reconnected with the host device 100.

FIG. 2 is a diagram illustrating a message format including the disk information provided by the host device 100 to the data storage device 200 shown in FIG. 1.

A message provided by the host device 100 may include a command CMD and the disk information. The disk information may include the number of regions, a starting logical address of respective region, and a last logical address of the respective region.

The command CMD may denote an operation to be performed by the data storage device 200 with the disk information. The data storage device 200 may newly store the disk information or may update the disk information stored therein based on the command CMD.

The number of regions may represent a number of regions being distinguished each other. In an embodiment, the regions may be distinguished in accordance with kind of disk partition, (e.g., swap partition, file system partition), name of the file system, kind of data managed by the file system (e.g., meta data, normal data). In other embodiments, the regions may be distinguished according to other criteria.

Each region may be identified with a corresponding region number. Each region may be related with the logical addresses that do not overlap the logical addresses related with other regions. Throughout the disclosure, the logical address may represent a logical block address. In the embodiment, it is assumed that the number of regions is two and the region numbers for the regions are I and J, respectively.

FIG. 3 illustrates an example of the disk information managed by the host device shown in FIG. 1.

The disk information may include a region number DI, and a logical address LBA corresponding to the region number DI. In the embodiment, logical addresses 0 to 100 may correspond to region number I and the logical addresses 101 to 2000 may correspond to region number J.

The host device 100 may transmit the disk information including both the region number and the corresponding logical addresses as shown in FIG. 2. If the relation between the region number and the corresponding logical addresses is predetermined, the region information may not be transmitted to the data storage device 200.

FIG. 4 illustrates an example of disk information and a physical address stored in the data storage device 200 shown in FIG. 1.

The disk information including the region number and the corresponding logical address may be stored in the second memory within the data storage device 200. The second memory 210 may further store the physical addresses corresponding to the disk information.

The disk information stored in the second memory 210 may include the region number and the logical address. As aforementioned, if a region may be identified only with the logical address, the region number may not be stored in the second memory 210.

Determining relationship between the disk information and the physical address will be disclosed in detail with reference to FIG. 8.

FIG. 5 is a flow chart illustrating an operation of the host device 100 when the disk information is updated in accordance with an embodiment of the present invention.

The host device 100 updates disk partition information at step S110.

The disk information management module 110 updates disk information to have data structure as shown in FIG. 3 at step S120. The disk partition information may be changed when an existing partition is divided and/or when existing partitions are merged. According to the change in disk partition information, a new region number may be generated or an existing region number may be deleted and relationship between a region number and logical addresses may change.

The host device 100 may transmit a message including the updated disk information as shown in FIG. 2 to the data storage device 200 at step S130.

After receiving the message, the controller 220 within the data storage device 200 may identify a command CMD and update the disk information as shown in FIG. 4.

When the partition information is updated, all data in the corresponding partition may be deleted. In this case, the controller 220 may reset physical addresses related to the updated region and may invalidate all corresponding pages in the third memory 230.

FIG. 6 is a flow chart illustrating an operation of the host device 100 when a disk partition is formatted in accordance with an embodiment of the present invention.

The host device 100 formats a disk partition at step S210.

The disk information management module 110 updates the disk information having data structure as shown in FIG. 3 at step S220.

The host device 100 may transmit a message including the updated disk information as shown in FIG. 2 to the data storage device 200 at step S230.

After receiving the message, the controller 220 within the data storage device 200 may identify a command CMD and update the disk information as shown in FIG. 4.

When a partition is formatted, all data in the corresponding partition may be deleted. In this case, the controller 220 may reset physical addresses related to the formatted region and may invalidate all corresponding pages in the third memory 230.

FIG. 7 is a flow chart illustrating an operation of the data storage device 200 to store disk information provided from the host device 100 in accordance with an embodiment of the present invention.

The data storage device 200 may receive a message including the disk information as shown in FIG. 2, at step S310.

The controller 220 may store new disk information or may update existing disk information according to the received message at step S320.

The controller 220 may back up the disk information at step S330. As aforementioned, the controller 220 may use the backup memory 240 or a part of the third memory 230.

The backup disk information may be used to reload the disk information when the host device 100 reboots and/or when the data storage device 200 is reconnected to the host device 100.

If necessary, the backup operation may be performed before when the disk information is updated, when power is turned off, and when the host device 100 and the data storage device 200 are disconnected.

FIG. 8 is a flow chart illustrating an operation of the data storage device 200 shown in FIG. 1.

The data storage device 200 receives a write request from the host device 100 at step S410.

The controller 220 may identify a region number corresponding to a requested logical address by referring to the second memory 210 at step S420.

The controller 220 may identify a current physical address corresponding to the identified region at step S430. The current physical address may represent a physical address most recently used among physical addresses corresponding to the identified region.

The controller 220 may check whether a free page exists in a block of the current physical address at step S440.

If a free page does not exist, the controller 220 may check whether a free block exists in the third memory 230, at step S450. If a free page exists, the controller 220 may process the write request at the free page in the free block at step S480.

If a free block exists, the controller 220 may allocate a new free block and updates the corresponding disk information at step 470.

If a free block does not exist, at step S460, the controller 220 may perform a garbage collection to make a free block and then may sequentially perform the steps S470 and S460.

The free block may have a physical address, which is not related to any logical address. The controller 220 may update the second memory 210 by relating the free block with a requested logical address.

By processing the write request as shown in FIG. 8, each block of the third memory 230 may include a plurality of page data corresponding to the same region. For example, two data each in a different region such as different partition or different file system may not be stored in the same block.

This may induce invalid pages to be confined in specific blocks, thereby reducing the number of garbage collection operations and the cost of each garbage collection operation.

In the following, an embodiment where the host device 100 transmits file information to the data storage device 200 is disclosed.

FIGS. 9 and 10 are diagrams illustrating a message format including file information provided by the host device 100 to the data storage device 200 shown in FIG. 1.

The message shown in FIG. 9 corresponds to a message including file information for one file, and the message shown in FIG. 10 corresponds to a message including file information for a plurality of files.

The message provided by the host device 100 may include a command CMD and file information. The file information may include an address, a length, and a file identification number UID of a corresponding file.

The command CMD denotes an operation performed by the data storage device 200 with the file information. The data storage device 200 may newly store the file information or may update the file information stored therein based on a command CMD.

The address denotes starting address of a corresponding file, and the length denotes a length of the corresponding file.

The file identification number UID denotes an identification number used by the host device 100 to identify the corresponding file and may be managed by the file information management module 120.

FIG. 11 illustrates an example of file identification number managed by the host device 100 shown in FIG. 1.

The file information may include a file identification number UID. If the host device 100 includes a plurality of file systems, each of the file systems may be related to a unique number, such as A and B, and each file in a file system may be related to a unique number such as 1233 and 1432.

The file identification number UID may be generated by combining a unique number for a corresponding file system and a unique number for a corresponding file in the file system. The format of the file identification number UID or method for generating the file identification number UID may change in accordance with embodiments.

FIG. 12 illustrates an example of file information and a physical address stored in the data storage device 200 shown in FIG. 1.

The file information and the related physical address may be stored in the second memory 210. The file information may include a file identification number UID. Each file identification number UID corresponds to a physical address. When a plurality of blocks are required to store a file, a last physical address used for the file is related to a file identification number UID.

FIG. 13 is a flow chart illustrating an operation of the host device 100 when a file is created in accordance with an embodiment of the present invention.

The host device 100 may create a new file at step S510.

The file information management module 120 may allocate a unique file number in a file system, may generate a file identification number UID as aforementioned, and may update file information as shown in FIG. 11 at step S520.

The host device 100 may transmit a write request with a file identification number UID to the data storage device 200 at step S530.

FIG. 14 is a flow chart illustrating an operation of the host device 100 where a file is modified in accordance with an embodiment of the present invention.

A request for file update is generated by the host device 100 at a step S610.

The host device 100 may check a file identification number UID corresponding to the file at step S620.

The host device 100 may transmit a write request with a file identification number UID to the data storage device 200 at step S630.

If the third memory 230 is a flash memory, an overwrite operation may be impossible therefore a new write request is performed.

FIG. 15 is a flow chart illustrating an operation of the data storage device 200 for handling a write request from the host device shown in FIG. 1.

The data storage device 200 may receive a write request with a file identification number UID from the host device 100, at step S710.

The controller 220 may check whether the received file identification number UID exists in the second memory 210, at step S720.

If the transmitted file identification number UID exists in the second memory 210, the controller 220 may find out a physical address corresponding to the file identification number UID with reference to the second memory 210 at step S730.

At step S770, if the transmitted file identification number UID does not exist in the second memory 210, the controller 220 stores the transmitted file identification number UID in the second memory 210 and relates a blank physical address to the transmitted file identification number UID. Then, the controller 220 performs the step S730.

The controller 220 may check whether a free page exists in the physical address at step S740.

If any free page does not exist in the physical address, the controller 220 may allocate a new free block and may update a second memory 220 to have physical address of the newly allocated block corresponding to the file identification number UID at step S760.

The controller 220 may write a data in the free page at step S750.

If a write request is processed as disclosed in FIG. 15, each block of the third memory 230 may include a data corresponding to the same file. This may induce invalid pages to be confined in specific blocks, thereby reducing the number of garbage collection operations and the cost of each garbage collection operation.

FIG. 16 is a flow chart illustrating an operation of the host device 100 when a file is deleted in accordance with an embodiment of the present invention.

The host device 100 deletes a file at step S810.

The file information management module 120 may delete file information including a file identification number UID corresponding to the deleted file at step S820.

The host device 100 may transmit a request to delete the file information to the data storage device 200 at step S830.

FIG. 17 is a flow chart illustrating an operation of the data storage device 200 for handling a file information delete request from a host device in accordance with an embodiment of the present invention.

The data storage device 200 may receive a request from the host device 100 at step S910.

The controller 220 may check whether the received request is for deleting file information at step S920.

If the request is not for deleting file information, the operation is terminated.

If the request is for deleting file information, the controller 220 may check whether a requested file identification number UID exists in the second memory 210 at step S930. If the corresponding file identification number UID does not exist, the operation is terminated.

The controller 220 may delete the requested file identification number UID from the second memory 210, thereby a mapping relation between the file identification number UID and physical addresses are deleted at step S940

The host device 100 may transmit logical addresses of deleted files with a TRIM command to make the corresponding pages to be invalidated. Since a block is filled with data corresponding to a file, the pages invalidated by the TRIM command may be confined in specific blocks and the cost for a garbage collection operation may be reduced.

Though the present invention is disclosed with reference to specific embodiments, the scope of the present invention is not limited thereto. The present invention may include any embodiments where a host device provides disk information and/or file information to a data storage device to process a request in its scope.

Although various embodiments have been described for illustrative purposes, it will be apparent to those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims. 

What is claimed is:
 1. A data storage device comprising: a storage memory; an information memory suitable for storing disk information and/or file information transmitted from a host device; and a controller suitable for processing a request on the data memory, which is received from the host device, based on the disk information and/or the file information stored in the information memory.
 2. The data storage device of claim 1, wherein the information memory stores physical address for the storage memory corresponding to the disk information and/or the file information.
 3. The data storage device of claim 2, wherein the request comprises information on disk and/or file corresponding to the request.
 4. The data storage device of claim 1, wherein the disk information includes logical address corresponding to a region managed by the host device, and the file information includes file identification number managed by the host device.
 5. The data storage device of claim 3, wherein the controller finds out the physical address for the storage memory corresponding to the information on disk and/or file and processes the request on the physical address.
 6. The data storage device of claim 5, wherein the controller inserts the information on disk and/or file in the request into the information memory and relates the inserted information with a new physical address of the storage memory if the information on disk and/or file in the request is not in the information memory.
 7. A system comprising: a data storage device; and a host device providing disk information and/or file information to the data storage device.
 8. The system of claim 7, wherein the data storage device comprises: a storage memory; an information memory suitable for storing the disk information and/or the file information transmitted from the host device; and a controller suitable for processing a request on the data memory, which is received from the host device based on the disk information and/or the file information in the information memory.
 9. The system of claim 8, wherein the host device comprises an information management module for managing the disk information and/or the file information.
 10. The system of claim 9, wherein the information management module includes a disk information management module suitable for managing the disk information and a file information management module suitable for managing the file information.
 11. The system of claim 8, wherein the request comprises information on disk and/or file corresponding to the request.
 12. The system of claim 8, wherein the disk information includes a logical address corresponding to a region managed by the host device, and the file information includes file identification number managed by the host device.
 13. The system of claim 11, wherein the controller finds out the physical address for the storage memory corresponding to the information on disk and/or file and processes the request on the physical address.
 14. The system of claim 13, wherein the controller inserts the information on disk and/or file in the request into the information memory and relates the inserted information with a new physical address of the storage memory, if the information on disk and/or file in the request is not in the information memory.
 15. An operating method of a system with a host device and a data storage device, the operating method comprising: receiving, by the data storage device, a request and information on disk and/or file corresponding to the request from the host device; identifying, by the data storage device, a first physical address corresponding to the information on disk and/or file; and processing, by the data storage device, the request on the first physical address if the first physical address is identified.
 16. The operating method of claim 15, further comprising: relating, by the data storage device, a second physical address with the information on disk and/or file if the first physical address is not identified; and processing, by the data storage device, the request on the second physical address.
 17. The operating method of claim 15, wherein the disk information includes a logical address corresponding to a region managed by the host device, and the file information includes file identification number managed by the host device.
 18. The operating method of claim 15, further comprising: updating, by host device, the disk information and/or the file information; and transmitting, by host device, the updated disk information and/or the updated file information to the data storage device.
 19. The operating method of claim 18, wherein the disk information includes a logical address corresponding to a region managed by the host device, and the file information includes file identification number managed by the host device. 